package b59;

public class Main4 {
    public static void main(String[] args) {
        int[] num = {1,2,3,4,7,7,7,8,8,8};
        System.out.println(getNum(num));
    }

    public static int getNum(int[] num) {
        if(num == null || num.length == 0) {
            return -1;
        }
        int len = num.length;
        int res = -1;
        boolean flag  = false;
        for (int i = 0; i < len; i++) {
            for (int j = 0; j < len ; j++) {
                if(num[i] == num[j] && i != j) {
                    flag = true;
                    break;
                }
            }
            if(!flag) {
                res = num[i];
            }
            flag = false;
        }
        return res;
    }
}
